/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Ex6_ex3;

/**
 *
 * @author Root
 */
public class Test_Banking {

    public static void main(String[] args) {
        Banking b = new Banking();
        Account a=new Account();
        Customer c1=new Customer("Jane", "smith");
        b.addCustomers(c1);
//        c1.setSaving_acc(new SavingsAccount(500, 3));
        c1.setChecking_acc(new CheckingAccount(200,500));
        System.out.println("customer ["+c1.getFirtname()+" , "+c1.getLastname()+"] has a checking balance of "+c1.getChecking_acc().getBalance()+" and a saving balance of "+c1.getChecking_acc().getOverdrafProtecttion());
        double w1=150;
//        c1.getChecking_acc().withdraw(150);

        System.out.println("customer acct ["+c1.getFirtname()+" , "+c1.getLastname()+"] : withdraw "+w1+" succeeds? "+c1.getChecking_acc().withdraw(w1));
        double w2=22.5;
        System.out.println("customer acct ["+c1.getFirtname()+" , "+c1.getLastname()+"] : deposit "+w2+" succeeds? "+c1.getChecking_acc().Deposit(w2));
        double w3=147.62;
        System.out.println("customer acct ["+c1.getFirtname()+" , "+c1.getLastname()+"] : withdraw "+w3+" succeeds? "+c1.getChecking_acc().withdraw(w3));
        System.out.println("customer ["+c1.getFirtname()+" , "+c1.getLastname()+"] : has a checking balance of "+c1.getChecking_acc().getBalance()+" and a saving balance of "+c1.getChecking_acc().getOverdrafProtecttion());

//         System.out.println("saving account :current balance is $"+c1.getSaving_acc().getBalance());
//         System.out.println("checking account :current balance is $"+c1.getChecking_acc().getBalance());

////        System.out.println("creating her  "+c1.getSaving_acc().toString());
        System.out.println("----------------------------------------------");
        Customer c2=new Customer("owen ", "Bryant");
        b.addCustomers(c2);
        c2.setChecking_acc(new CheckingAccount(200));
        System.out.println("customer ["+c2.getFirtname()+" , "+c2.getLastname()+"] has a checking balance of "+c2.getChecking_acc().getBalance());
        double w12=100;
//        c1.getChecking_acc().withdraw(150);

        System.out.println("customer acct ["+c2.getFirtname()+" , "+c2.getLastname()+"] : withdraw "+w12+" succeeds? "+c2.getChecking_acc().withdraw(w12));
        double w22=25;
        System.out.println("customer acct ["+c2.getFirtname()+" , "+c2.getLastname()+"] : deposit "+w22+" succeeds? "+c2.getChecking_acc().Deposit(w22));
        double w32=175;
        System.out.println("customer acct ["+c2.getFirtname()+" , "+c2.getLastname()+"] : withdraw "+w32+" succeeds? "+c2.getChecking_acc().withdraw(w32));
        System.out.println("customer ["+c1.getFirtname()+" , "+c1.getLastname()+"] : has a checking balance of "+c2.getChecking_acc().getBalance());

//        System.out.println("saving account :current balance is $"+c2.getSaving_acc().getBalance());
//         System.out.println("checking acct :current balance is $"+c2.getChecking_acc().getBalance());
//        System.out.println("creating his "+c2.getChecking_acc().toString());
        System.out.println("----------------------------------------------");
        Customer c3=new Customer("Tim ", "soley");
        b.addCustomers(c3);
        c3.setSaving_acc(new SavingsAccount(1500, 0));
        c3.setChecking_acc(new CheckingAccount(200, 500));
        System.out.println("saving account :current balance is $"+c3.getSaving_acc().getBalance());
         System.out.println("checking account :current balance is $"+c3.getChecking_acc().getBalance());
//        System.out.println("creating his "+c3.getChecking_acc().toString());
        System.out.println("----------------------------------------------");
        Customer c4=new Customer("maria ", "soley");
        b.addCustomers(c4);
        c4.setChecking_acc(new CheckingAccount(200));
        c4.setSaving_acc(new SavingsAccount(150, 0));
        System.out.println("saving account :current balance is $"+c4.getSaving_acc().getBalance());
         System.out.println("checking account :current balance is $"+c4.getChecking_acc().getBalance());
//        System.out.println("maria shares her Checking account with her husband Tim");
//        System.out.println("----------------------------------------------");
//        System.out.println("Retrieving the customer jane smith with her savings account");
//        System.out.println("withdraw 150 : "+c1.getSaving_acc().withdraw(150));
//        System.out.println("deposit 22.5:"+c1.getSaving_acc().Deposit(22.5));
//        System.out.println("withdraw 47.62 : "+c1.getSaving_acc().withdraw(47.62));
//        System.out.println("withdraw 400:"+c1.getSaving_acc().withdraw(400));
//        System.out.println("customer ["+c1.getLastname()+ " , "+c1.getFirtname()+" ]"+c1.getSaving_acc().toString2());
//        System.out.println("----------------------------------------------");
//        System.out.println("Retrieving the customer owen bryant with his checking account");
//        System.out.println("withdraw 150 : "+c2.getChecking_acc().withdraw(150));
//        System.out.println("deposit 22.5:"+c2.getChecking_acc().Deposit(22.5));
//        System.out.println("withdraw 47.62 : "+c2.getChecking_acc().withdraw(47.62));
//        System.out.println("withdraw 400:"+c2.getChecking_acc().withdraw(400));
//        System.out.println("customer ["+c2.getLastname()+ " , "+c2.getFirtname()+" ]"+c2.getChecking_acc().toString2());
//
//        System.out.println("----------------------------------------------");
//        System.out.println("Retrieving the customer Tim soley with his checking account with no overdraft protection");
//        System.out.println("withdraw 150 : "+c3.getChecking_acc().withdraw(150));
//        System.out.println("deposit 22.5:"+c3.getChecking_acc().Deposit(22.5));
//        System.out.println("withdraw 47.62 : "+c3.getChecking_acc().withdraw(47.62));
//        System.out.println("withdraw 400:"+c3.getChecking_acc().withdraw(400));
//        System.out.println("customer ["+c3.getLastname()+ " , "+c3.getFirtname()+" ]"+c3.getChecking_acc().toString2());
//        System.out.println("----------------------------------------------");
    }
}
